<?php

include_once('connexion.php');
	
if(isset($_POST['search_contest_submit']))
{
	$searchEvent = $_POST['search_contest_event'];
	if($searchEvent == 0)
	{
		$searchEvent = null;
		$searchSport = null;
	}
	else
	{
		$searchEvent = $sportsEventManager->get((int) $searchEvent);
		$searchSport = $sportsManager->get((int) $searchEvent->sport_id());
	}
	$searchPublic = $_POST['search_contest_public'];
	$_SESSION['contestsResultSearch'] = $contestManager->getListContests($searchSport, $searchEvent, null, $searchPublic);
}
header('Location: listcontest.php');


?>